<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.1</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <link rel="stylesheet" href="/static/admin/css/font.css">
    <link rel="stylesheet" href="/static/admin/css/font-awesome.min.css">
    <style>
        .layui-form-item .layui-form-label{
            width: 120px;
        }
        .layui-form-item .layui-textarea{
            width: 190px;
        }
        #phone-one-div {display: none}
    </style>
  </head>
  
  <body>
    <div class="x-body">
        <form class="layui-form">
          <div class="layui-form-item">
              <label for="activity" class="layui-form-label">
                  <span class="x-red">*</span>活动名称
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="activity_name" value="{$info.activity_name}" name="activity_name" lay-verify="required" required="" autocomplete="off" class="layui-input">
              </div>
          </div>
          <!--<div class="layui-form-item">-->
          <!--    <label for="name" class="layui-form-label">-->
          <!--        <span class="x-red">*</span>业务员姓名-->
          <!--    </label>-->
          <!--    <div class="layui-input-inline">-->
          <!--        <input type="text" id="staff_name" value="{$info.staff_name}" name="staff_name" lay-verify="required"  required="" autocomplete="off" class="layui-input">-->
          <!--    </div>-->
          <!--</div>-->
          <div class="layui-form-item">
              <label for="name" class="layui-form-label">
                  <span class="x-red">*</span>业务员
              </label>
              <div class="layui-input-inline">
                  <select name="to_admin_id" lay-search lay-verify="required" required lay-filter="filter">
                        <option value="">请选择</option>
                        {volist name="staffList" id="value"}
                        <option value="{$value.id}" {if condition="$info.to_admin_id == $value.id "}selected{/if}>{$value.name}</option>
                        {/volist}
                    </select>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="name" class="layui-form-label">
                  专题
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="topic_count" value="{$info.topic_count}" name="topic_count" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="name" class="layui-form-label">
                  单页
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="single_count" value="{$info.single_count}" name="single_count" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="name" class="layui-form-label">
                  制作时间
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="complete_time" value="{if condition='$info.complete_time'}{:date('Y-m-d',$info.complete_time)}{/if}" name="complete_time" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="note" class="layui-form-label">
                  备注/其它
              </label>
              <div class="layui-input-block">
                <textarea name="note" placeholder="备注/其它" class="layui-textarea">{$info.note}</textarea>
              </div>
          </div>
          
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button type="button" class="layui-btn" lay-filter="add" lay-submit="">
                  确定
              </button>
          </div>
      </form>
    </div>

    <script>
        layui.use(['form','layer','laydate','upload'], function(){
          $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer
          ,laydate = layui.laydate
          ,upload = layui.upload;
          
          laydate.render({
            elem: '#complete_time'
          });

          //监听提交
          form.on('submit(add)', function(data){

            
            $.ajax({
                type:'POST',
                dataType:'json',
                data:{data:data.field},
                success:function(obj){
                      layer.alert(obj.msg, {icon: obj.icon},function(){
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前frame
                        parent.layer.close(index);
                        // 可以对父窗口进行刷新 
                        x_admin_father_reload();
                      });    
                }
            });
            return false;
          });
          
          
        });
    </script>
  </body>

</html>